home *** CD-ROM | disk | FTP | other *** search
/ Visual Basic Source Code / Visual Basic Source Code.iso / vbsource / bitmap / bitmap.gbl < prev    next >
Text File  |  1991-07-08  |  5KB  |  96 lines

  1. DefInt A-Z
  2.  
  3. Global Const True = -1, False = 0
  4. Global Const MODELESS = 0, MODAL = 1
  5.  
  6. Type POINTapi
  7.     x As Integer
  8.     y As Integer
  9. End Type
  10.  
  11. '   Ternary raster operations
  12. Global Const SRCCOPY = &HCC0020     ' (DWORD) dest = source
  13. Global Const SRCPAINT = &HEE0086    ' (DWORD) dest = source OR dest
  14. Global Const SRCAND = &H8800C6      ' (DWORD) dest = source AND dest
  15. Global Const SRCINVERT = &H660046   ' (DWORD) dest = source XOR dest
  16. Global Const SRCERASE = &H440328    ' (DWORD) dest = source AND (NOT dest )
  17. Global Const NOTSRCCOPY = &H330008  ' (DWORD) dest = (NOT source)
  18. Global Const NOTSRCERASE = &H1100A6 ' (DWORD) dest = (NOT src) AND (NOT dest)
  19. Global Const MERGECOPY = &HC000CA   ' (DWORD) dest = (source AND pattern)
  20. Global Const MERGEPAINT = &HBB0226  ' (DWORD) dest = (NOT source) OR dest
  21. Global Const PATCOPY = &HF00021     ' (DWORD) dest = pattern
  22. Global Const PATPAINT = &HFB0A09    ' (DWORD) dest = DPSnoo
  23. Global Const PATINVERT = &H5A0049   ' (DWORD) dest = pattern XOR dest
  24. Global Const DSTINVERT = &H550009   ' (DWORD) dest = (NOT dest)
  25. Global Const BLACKNESS = &H42&      ' (DWORD) dest = BLACK
  26. Global Const WHITENESS = &HFF0062   ' (DWORD) dest = WHITE
  27.  
  28. '  StretchBlt() Modes
  29. Global Const BLACKONWHITE = 1
  30. Global Const WHITEONBLACK = 2
  31. Global Const COLORONCOLOR = 3
  32.  
  33. Declare Function PatBlt Lib "GDI" (ByVal hDC As Integer, ByVal x As Integer, ByVal y As Integer, ByVal nWidth As Integer, ByVal nHeight As Integer, ByVal dwRop As Long) As Integer
  34. Declare Function BitBlt Lib "GDI" (ByVal hDestDC As Integer, ByVal x As Integer, ByVal y As Integer, ByVal nWidth As Integer, ByVal nHeight As Integer, ByVal hSrcDC As Integer, ByVal XSrc As Integer, ByVal YSrc As Integer, ByVal dwRop As Long) As Integer
  35. Declare Function StretchBlt Lib "GDI" (ByVal hDC%, ByVal x%, ByVal y%, ByVal nWidth%, ByVal nHeight%, ByVal hSrcDC%, ByVal XSrc%, ByVal YSrc%, ByVal nSrcWidth%, ByVal nSrcHeight%, ByVal dwRop&) As Integer
  36. Declare Function TextOut Lib "GDI" (ByVal hDC As Integer, ByVal x As Integer, ByVal y As Integer, ByVal lpString As String, ByVal nCount As Integer) As Integer
  37. Declare Function TabbedTextOut Lib "GDI" (ByVal hDC As Integer, ByVal x As Integer, ByVal y As Integer, ByVal lpString As String, ByVal nCount As Integer, ByVal nTabPositions As Integer, lpnTabStopPositions As Integer, ByVal nTabOrigin As Integer) As Long
  38. Declare Function GetCharWidth Lib "GDI" (ByVal hDC As Integer, ByVal wFirstChar As Integer, ByVal wLastChar As Integer, lpBuffer As Integer) As Integer
  39. Declare Function SetPixel Lib "GDI" (ByVal hDC As Integer, ByVal x As Integer, ByVal y As Integer, ByVal crColor As Long) As Long
  40. Declare Function GetPixel Lib "GDI" (ByVal hDC As Integer, ByVal x As Integer, ByVal y As Integer) As Long
  41.  
  42. Declare Function MoveTo Lib "GDI" (ByVal hDC As Integer, ByVal x As Integer, ByVal y As Integer) As Long
  43. Declare Function LineTo Lib "GDI" (ByVal hDC As Integer, ByVal x As Integer, ByVal y As Integer) As Integer
  44. Declare Function Polyline Lib "GDI" (ByVal hDC As Integer, lpPoints As POINTapi, ByVal nCount As Integer) As Integer
  45. Declare Function Polygon Lib "GDI" (ByVal hDC As Integer, lpPoints As POINTapi, ByVal nCount As Integer) As Integer
  46. Declare Function PolyPolygon Lib "GDI" (ByVal hDC As Integer, lpPoints As POINTapi, lpPolyCounts As Integer, ByVal nCount As Integer) As Integer
  47.  
  48. Declare Function GetSysColor Lib "User" (ByVal nIndex As Integer) As Long
  49.  
  50. Global BltModeArray(0 To 14) As Long
  51.  
  52.  
  53. '=====  Global Stuff for FOPEN (thanks to Costas Kitsos) =====
  54.  
  55. ' This is used by OpenFile when we check if a file exists
  56. Type OfStruct
  57.     RecLen As String * 1
  58.     IsFixed As String * 1
  59.     ErrCode As Integer
  60.     Reserved As String * 4
  61.     CompleteName As String * 128
  62. End Type
  63.  
  64. ' OpenFile is used to check if a file exists.
  65. ' Lclose closes the file opened with OpenFile
  66. Declare Function OpenFile Lib "kernel" (ByVal fname$, aStruct As OfStruct, ByVal ofstyle%) As Integer
  67. Declare Function lclose Lib "kernel" Alias "_lclose" (ByVal FHandle%) As Integer
  68.  
  69. ' These give us the Win3 like Drive/Subdirectory listing
  70. Declare Function GetFocus Lib "user" () As Integer
  71. Declare Function SendMessage Lib "user" (ByVal a%, ByVal b%, ByVal c%, ByVal d As Any) As Long
  72.  
  73. ' The following variables are shared by all forms:
  74.  
  75. ' FormTitle specifies FOPEN.FRM's title so the Parent can change it at will.
  76. ' FullName is the complete filename the user selects with FOPEN.FRM;
  77. '   it includes drive, subdirectory and filename (empty if the user presses Cancel).
  78. ' TheFileName is the filename.
  79. ' ThePath contains the path for open file, can also be used to point to a different
  80. '   path for FOPEN.FRM.
  81. ' ThePattern sets/resets the file pattern, e.g. "*.BAS"
  82.  
  83. Global FormTitle As String
  84. Global FullName As String
  85. Global TheFileName As String
  86. Global ThePath As String
  87. Global ThePattern As String
  88.  
  89. ' These are used by the API functions
  90. Global Const WM_USER = &H400
  91. Global Const LB_DIR = WM_USER + 14
  92. Global Const LB_RESETCONTENT = WM_USER + 5
  93. Global Const EM_LIMITTEXT = WM_USER + 21
  94. Global Const OF_EXIST = &H4000
  95.  
  96.